Skip to content

update method can be called after component has been destroyed #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2019

Conversation

thooyork
Copy link

It is possible to call the update() method on an asyncComputed property even if the component has been destroyed. One could save a reference to the instance beforehand.

This simple if statement should prevent that behaviour.

@foxbenjaminfox
Copy link
Owner

Thanks for the PR; you make a good point.

Before I merge this, it would be nice if we also had a test for this bug as part of the project's test suite. Would you like to add such a test? Or I could add it, if you'd rather.

@thooyork
Copy link
Author

Thanks for your quick response, I'd appreciate if you would write that test.

@foxbenjaminfox foxbenjaminfox merged commit 51515b3 into foxbenjaminfox:master Dec 23, 2019
@foxbenjaminfox
Copy link
Owner

I've added a test, and included this bugfix in the v3.8.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants